#pragma once
#include "../functions.h"

void powered() {
  const short operation =
      get_choice("Операция", {"Возведение в степень", "Извлечение корня"});
  const double a = numeric_input("Число");
  const int b = numeric_input("Степень");

  double operation_result;

  switch (operation) {
    case 1:
      operation_result = pow(a, b);
      print_equation({a, get_superscript(b), operation_result});
      break;
    case 2:
      operation_result = pow(a, 1 / b);
      print_equation(
          {get_superscript(b), get_math_symbol("root"), a, operation_result});
      break;
  }
}